package com.xxx.proj.nacosconsumer.myconsumer;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

@Component
@RocketMQMessageListener(consumerGroup = "my-topic", topic = "myTopic")
public class MyConsumer implements RocketMQListener<String> {


    @Override
    public void onMessage(String string) {
        System.out.println("收到的消息 = " + string);
    }
}
